package com.cheng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheng.common.exception.CommonException;
import com.cheng.common.utils.StringUtil;
import com.cheng.data.entity.GvmtTypeInfEntity;
import com.cheng.data.mapper.GvmtTypeInfMapper;
import com.cheng.service.GvmtTypeInfService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: ChengJW
 * @date: 2021/11/8 20:08
 * @version: 1.0
 * @description: 有关 gvmt_type_inf 表的操作
 */
@Service
public class GvmtTypeInfServiceImpl implements GvmtTypeInfService {

    private final static Logger log = LoggerFactory.getLogger(GvmtTypeInfServiceImpl.class);

    @Autowired
    private GvmtTypeInfMapper gvmtTypeInfMapper;

    /**
     * @author: ChengJW
     * @params: [entity]
     * @return: java.util.List<com.cheng.data.entity.GvmtTypeInfEntity>
     * @date: 2021/11/8
     * @description: 根据条件查询 gvmt_type_info 列表信息
     */
    @Override
    public List<GvmtTypeInfEntity> queryGvmtTypeInf(GvmtTypeInfEntity entity) throws CommonException {

        QueryWrapper<GvmtTypeInfEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtil.isNotNull(entity.getGtTypeCode()),"gt_type_code",entity.getGtTypeCode());
        return gvmtTypeInfMapper.selectList(wrapper);
    }
}
